// 定义store
import { defineStore } from "pinia";
import { ref } from "vue";

export const useUserStore = defineStore("user", () => {
    // 定义状态内容
    const companyName = ref("");

    // 修改token值
    const setCompanyName = (newCompanyName) => {
      companyName.value = newCompanyName;
    }

    // 移除token值
    const removeCompanyName = () => {
      companyName.value = "";
    }

    // 返回状态内容
    return { companyName, setCompanyName, removeCompanyName };
},{
    persist: true, // 开启持久化
}
);